<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/common/meta.jsp"%>
<title>汪星客--登录</title>
</head>
<body>
<div class="wrap">
	<div class="header_bg">
	  <%@ include file="/common/header.jsp"%>
	</div>
    <div class="dogtr-login">
        <div class="dogtr-logintit">欢迎登录汪星客</div>
        <div class="dogtr-logincon">
        	<div class="L">
				<form id="win_login_form" method="post" action="${ctx}/login/login.do">
                <p class="dogtr-ti"><span>*</span> 登录账号</p>
                <p>
					<input class="easyui-validatebox emailpwd " tabindex="1" name="username" data-options="required:true, prompt:'请填写您的登录账号。', validType:['length[5,50]']"/>
				</p>
                <p class="dogtr-ti">
<!--                 	<a href="#">忘记密码？</a> -->
                	<span>*</span> 密码
                </p>
                <p>
					<input class="easyui-validatebox emailpwd" tabindex="2" name="password" type="password" data-options="required:true, validType:'Password[6,50]', prompt:'请填写您的登录密码。'"/>
				</p>
				<p id="win_login_err" style="color: red"></p>
                <p>
                	<label><input type="checkbox" />&nbsp;在这台电脑上保持我的登录状态</label></p>
                <p>
                	<a href="javascript:void(0)" class="easyui-linkbutton tg-btn" onclick="submitLogin()">登录</a>
                </p>
                <p class="gotoreg">还没有账号？赶快 <a href="${ctx}/reg/reg.do">去注册吧!</a></p>
				</form>
            </div>
            <!-- <div class="R">
            	<p class="dogtr-loginother">用其他帐户登录:</p>
                <p><a href="#"><span class="qqlogin"></span>QQ账号登录</a></p>
                <p><a href="#"><span class="sinalogin"></span>新浪微博账号登录</a></p>
            </div> -->
        </div>
    </div>
	<div class="footer_bg">
		<%@ include file="/common/footer.jsp"%>
	</div>
</div>
</body>
<script type="text/javascript">
		function submitLogin() { 
			$("#win_login_form").form('submit', {  
				onBeforeLoad:function(param){
					$("#win_login_err").html("");
				},
			    success: function(resStr) {
			        var res = tools.s2j(resStr);
			        if (res.code == 1) {
			        	if("${param['redirectURL']}" == "") {
				        	window.location.href = "${ctx}/";
			        	} else {
			        		window.location.href = "${param['redirectURL']}";
			        	}
			        } else {
			        	$("#win_login_err").html("登录失败:" + res.msg);
			        }
			    }  
			}); 
		}
</script>
</html>
